package com.stagewebserver.webserver.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.stagecommon.common.pojo.WorkComment;
import com.stagecommon.common.vo.WorkCommentVo;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yxl
 * @since 2021-11-07
 */
public interface WorkCommentMapper extends BaseMapper<WorkComment> {

    /**
     * 根据作品id获取作品的评论
     * @param workId
     * @return
     */
    List<WorkCommentVo> selectCommentsByWorkId(Long workId);

    IPage<WorkCommentVo> selectAllWorkCommentsByPage(Page<WorkCommentVo> page, String content);

    WorkCommentVo selectCommentById(Long commentId);

    Integer insertWorkComment(Integer userId,String content,Long workId);

    void updateContentPraise(long objId, long likesNum);

    Long selectCountPraise(Long objId);
}
